The present invention, relates to the provision of check quantities for digital data, particularly for data transmission.
The use of ECC (error detecting and/or correcting codes) for digital data is well established. ECC is used, where the data is to be stored or transmitted by some means which is liable to occasional error. The data has a check portion or field appended to it to form a packet when it is entered into the storage or transmission means. When the packet is retrieved, the check field is used to detect whether errors have occurred and, in some situations, to correct them. A new check field may for example be calculated from the data field of the packet and compared with the check field in the packet. It is convenient to distinguish the data and check portions of the packet, but the check field checks the entire packet, ie itself as well as the data field.
A variety of ECC techniques have been proposed. Obviously, ease of implementation is important; for practical utilization, there must be some easily implemented algorithm for calculating the check field from the data field. If the system is to be used for error correction, then there must also be an effective technique for calculating the required corrections to the data field from the (erroneous) packet. However, if only error detection is required, then there is no need for an efficient means of determining the precise nature of the error. Pure error detection, with no correction, is for examples commonplace in many message transmission networks, because if an error is detected, the message can be retransmitted.
A widely used group of ECCs is cyclic ECCs. These are generally known as CRCs (cyclic redundancy check codes), and can readily be used for checking fields of variable length. A CRC code generates a check field which is termed the CRC field and is normally appended to the end of the data being checked. The present invention finds its main application with CRCs, and will be described in terms of CRCs rather than ECCs generally.
For present purposes, a CRC can be regarded as involving the division of the data field (regarded as a binary value) by a fixed binary value termed a polynomial, using arithmetic over the Galois fields GF2 (ie modulo 2 and without carries between different positions). The remainder is the CRC or check field. The classical technique for calculating a CRC involves using a shift register with a feedback circuit including XOR gates at the positions corresponding to the 1s (powers of x) in the polynomial. (Details of this can be found in Error Correcting Codes, 2nd edition, Peterson and Weldon, MIT 1972.)
Many digital systems, consist of a variety of physically distributed units, and require data to be passed between the various units. In some such systems, the connections may be relatively simple; eg there may be separate connections between each pair of units, or there may be a single master unit to which all other units are connected. In most large multi-unit systems, however, the connections between the units, together with the interfaces between the units and the connections, form a distinct subsystem.
Such a subsystem is termed a digital data transmission network. Such a network may consist of a switching network having a number of switching nodes interconnected with each other, or an area network such as a LAN (Local Area Network), or a combination of switching networks and area networks. (An area network has a common communication medium with, normally, a large number of units connected to it.)
The present invention is mainly, though not exclusively, concerned with such digital data transmission networks.
With such networks, it is the responsibility of the network to achieve the proper carriage of data between the end units connected to the network. This typically involves determining suitable routing for the data (eg through a suitable sequence of switching nodes). The routing information required for this is a function of the network, independent of the end units. The switching network therefore normally has to add a header including routing information to the data as received from the source (originating) end unit. This header is either stripped off just before the message is delivered to the destination (receiving) end unit, or is ignored by that unit.
This complicates the application of ECC.
The original data, as generated by the originating end unit, will often be generated with its own CRC, and for various reasons, it is often highly desirable for the data to retain this CRC throughout its journey to the receiving end unit. The transmission network must therefore treat this combination of data plus its CRC as a unit (which we will term a packet). The transmission network adds a header to this packet (we will term this combination of header plus packet a message). (It will be realized that terms such as packet and message are used here with specific senses which may not be identical with their usual meanings in the context of message transmission networks.)
Just as for the data generally, it is often desirable for the header to be checkable; ie for ECC to be applied. But the precise manner in which ECC (which means, in practice, CRC) is applied to the message involves various considerations and is not entirely straightforward.
One option is not to use a CRC for the header, in the expectation that an error in the header will result in the message failing to reach an end unit or, if it reached the wrong end unit, that end unit rejecting it; the sending end until will then not receive an acknowledgement of its receipt, and will in due course resend it. This may not be acceptable.
A second option is to generate a header CRC for the header, so that the message consists of the header with its CRC, plus the packet (the data with its CRC).
A third option is for the packet to be encapsulated, with the header being added to the front of the packet and a combined CRC for the header plus packet being calculated and added at the end of the message.
A factor which has to be taken into consideration in selecting an option is whether the transmission network protocol is predetermined. If it is not, then any option may be chosen. But if it is, then the choice of option may be forced. The standard protocols require that the message should have a CRC at the end which checks the entire message, which forces the adoption of the third option.
The main object of the present invention is to provide an improved technique for providing error detection for messages in message networks.
The crux of the present invention lies in including, in the header of a message, a check correction field (CCF) which is chosen such that the CRC of the packet is also a valid CRC for the entire message. This means that the message will automatically conform to the usual message network protocol. (It will be realized that the nature of the contents of the header is not relevant, although we have described the header as containing routing information for use in a message network.)
The main advantage of this is that the CRC of the message forms a check for both the data of the original packet and the header, so a single CRC check verifies the accuracy of both the message as a whole and the data alone. This is in contrast to the known techniques discussed above. In the first of those, the header is not checked, and in the second, it is obvious that the header and the data are checked independently. In the third, the packet encapsulation technique, it is possible for an error to occur in the packet as the CRC for the message (packet plus header) is being calculated; so a CRC check on the entire message using the CRC of the message, therefore verified only the message header, and a second CRC check is therefore required on the packet extracted from the message to verify the integrity of the data.
The construction of the CCF will normally be performed in the interfacing between the originating end unit and the message network. Although the general functionality of this interfacing may be determined by the predetermined characteristics of the message network, it will normally be controllable by the user to the extent that it can be arranged to generate the CCF.
In some complex message networks, it may be necessary for the header to be changed as the message passes through the network. Again, the network nodes where this takes place will normally be controllable by the user to the extent that they can be arranged to generate a CCF for the new header which maintains the CRC of the packet as valid for the whole message.
An essential feature of the present system is that the CCF can be determined without reference to the packet, ie from the header alone. It will be realized that this places a certain constraint on the nature of the ECC used. Broadly, the ECC must be linearly superposable (or be divisible into components which are linearly superposable) rather than being one which performs an encryption (of the kind intended to discourage or prevent unauthorized reading of the information).
Broadly, the process of generating the check field must be linear, in the sense that the sum of the check fields for two different fields (the original data and the header) is the check field for the concatenation of the fields. This constraint is in fact satisfied by most popular ECCs, including in particular CRCs, and also by other codes with the appropriate structure of linear components, such as BCH codes.
The simple or basic CRC has been developed into a form known as xe2x80x9cmodified CRCxe2x80x9d. This involves the use of a second polynomial which is dependent on the length of the message. This form prevents two concatenated messages with CRCs from forming a single message with a correct CRC. For example, the X.25 standard uses a polynomial
X15+X14+. . . +X1+1)(Xk+16+1), 
where the first terms in the product is a conventional CRC polynomial (with selected powers of x) and the second term is dependent on the length of k of the data field. Although this is not linear, it can be separated into components which behave linearly for present purposes.
This modified CRC has now displaced the standard CRC virtually completely in message networks, and from here on we will work exclusively in terms of this modified CRC.
The calculation of the CCF depends on its location in the header. If it is at the end of the header, the calculation consists of calculating the CRC for the header (eg by using a conventional feedback shift register) and then making a fixed adjustment to it, which can be treated as an inversion (ie XORing with an all 1s subfield).
It may be desirable to locate the CCF inside the header, ie not at the end. If this is the case, the calculation of the CRC for the header requires a minor adjustment. The portion of the header following the CCF has to be divided not by the CRC polynomial but by its reciprocal polynomial, obtained by reading it in the reverse direction (eg the reciprocal polynomial of x3+x2+x0 is x3+x1+x0). The result of this calculation has to be combined with the result for the portion of the header preceding the CCF by exclusive-ORing (without inversion). If the CCF is the last field of the header, then the result of the backwards calculation with the reciprocal polynomial is a constant which depends only on the polynomial, and can easily be combined into the CCF.
The routing header will normally consist of a number of subfields, eg destination, source, and message type. In many situations, most or all of these subfields will be known in advance. This means that their contributions to the CCF (check subfields) can be calculated in advance. The CCF can the generally be determined by a relatively simple calculation based on those pre-calculated check subfields (XORing the check subfields together, and incorporating the fixed adjustment described above). Of course, if a new subfield is required, then its check subfield has to be calculated.
If the subfields occur largely in fixed or mainly fixed combinations, the combined contribution of these subfields to the CCF can also, of course, be pre-calculated as a single value. Similarly, it may be possible to include the result of the backwards calculation with the reciprocal polynomial (if required) in this value. Calculating the CCF will then involve combining the contribution of the fixed combination of subfields with the check subfields of any further header subfields.
The precalculation of the value of a check subfield may be done by calculating it as a normal CRC check field for the header using a feedback shift register (taking all the other header subfields as empty). This check subfield value must then be stored with the associated header subfield.
If the message is to pass through two different levels of switching network, a header with a CCF field may be added at one stage and a second header with its own CCF field added at a later stage, with the original header (with its CCF field) being treated as part of the packet or data. Such a switching network may also require the position of some components of the message to be changed. Such components must also be treated as parts of the new header.